package com.example.animation.customviewgroup;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.example.animation.R;

import java.util.ArrayList;
import java.util.List;

public class MyViewGroupActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_view_group);

        MyViewGroup mLayout = (MyViewGroup) findViewById(R.id.myviewgroup);
        for (int i = 0; i < 3; i++) {
            ListView listView = new ListView(this);
            List<String> list = new ArrayList<>();
            for (int i1 = 0; i1 < 50; i1++) {
                list.add("page" + i + ", name: " + i1);
            }
            ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);
            listView.setAdapter(adapter);
            mLayout.addView(listView);
        }
    }
}
